import { axiosInstance } from 'src/boot/axios'
import CommonConfig from 'src/assets/js/config'
// import qs from 'qs'

const baseUrlTpm = CommonConfig.tpmUrl + '/v1'
// const qsConfig = {
//   arrayFormat: 'repeat',
//   skipNulls: true,
//   format: 'RFC3986'
// }
// 维修履历列表
export function repairLogsList (query) {
  const newUrl = baseUrlTpm + '/deviceRepair/records'
  let reqData = {
    params: {
      deviceId: query.deviceId || null,
      schemeId: query.schemeId,
      schemeLevel: query.schemeLevel,
      pageNum: query.pageNum,
      pageSize: query.pageSize
    }
  }
  return axiosInstance.get(newUrl, reqData).then((res) => {
    return Promise.resolve(res)
  })
}

// 维修履历详情
export function repairLogsDetail (id) {
  const newUrl = `${baseUrlTpm}/deviceRepair/recordsDetail/${id}`
  return axiosInstance.get(newUrl).then((res) => {
    return Promise.resolve(res)
  })
}
